AmCharts.GaugeAxis=AmCharts.Class({construct:function(){this.radius="95%";this.startAngle=-120;this.endAngle=120;this.startValue=0;this.endValue=200;this.valueInterval=20;this.minorTickInterval=5;this.tickLength=10;this.minorTickLength=5;this.tickColor="#555555";this.labelFrequency=this.tickThickness=this.tickAlpha=1;this.inside=!0;this.labelOffset=15;this.showLastLabel=this.showFirstLabel=!0;this.axisThickness=1;this.axisColor="#000000";this.axisAlpha=1;this.gridInside=!0;this.topText="";this.topTextYOffset=0;this.topTextBold=!0;this.bottomText="";this.bottomTextYOffset=0;this.bottomTextBold=!0;this.centerY=this.centerX="0%";this.bandOutlineAlpha=this.bandOutlineThickness=0;this.bandOutlineColor="#000000";this.bandAlpha=1},value2angle:function(t){return this.startAngle+this.singleValueAngle*t},setTopText:function(t){this.topText=t;var i=this.chart;if(this.axisCreated){this.topTF&&this.topTF.remove();var s=this.topTextFontSize;s||(s=i.fontSize);var a=this.topTextColor;a||(a=i.color);i=this.chart;t=AmCharts.text(i.container,t,a,i.fontFamily,s,void 0,this.topTextBold);t.translate(this.centerXReal,this.centerYReal-this.radiusReal/2+this.topTextYOffset);this.chart.graphsSet.push(t);this.topTF=t}},setBottomText:function(t){this.bottomText=t;var i=this.chart;if(this.axisCreated){this.bottomTF&&this.bottomTF.remove();var s=this.bottomTextFontSize;s||(s=i.fontSize);var a=this.bottomTextColor;a||(a=i.color);i=this.chart;t=AmCharts.text(i.container,t,a,i.fontFamily,s,void 0,this.bottomTextBold);t.translate(this.centerXReal,this.centerYReal+this.radiusReal/2+this.bottomTextYOffset);this.bottomTF=t;this.chart.graphsSet.push(t)}},draw:function(){var t=this.chart,i=t.graphsSet,s=this.startValue,a=this.valueInterval,h=this.startAngle,e=this.endAngle,r=this.tickLength,o=(this.endValue-s)/a+1,n=(e-h)/(o-1),l=n/a;this.singleValueAngle=l;var u=t.container,c=this.tickColor,d=this.tickAlpha,m=this.tickThickness,A=a/this.minorTickInterval,g=n/A,f=this.minorTickLength,C=this.labelFrequency,p=this.radiusReal;this.inside||(p-=15);var v=t.centerX+AmCharts.toCoordinate(this.centerX,t.realWidth),x=t.centerY+AmCharts.toCoordinate(this.centerY,t.realHeight);this.centerXReal=v;this.centerYReal=x;var T={fill:this.axisColor,"fill-opacity":this.axisAlpha,"stroke-width":0,"stroke-opacity":0},w,b;this.gridInside?b=w=p:(w=p-r,b=w+f);var M=this.axisThickness/2,e=AmCharts.wedge(u,v,x,h,e-h,w+M,w+M,w-M,0,T);i.push(e);e=AmCharts.doNothing;AmCharts.isModern||(e=Math.round);for(T=0;T<o;T++){M=s+T*a;w=h+T*n;var k=e(v+p*Math.sin(w/180*Math.PI)),N=e(x-p*Math.cos(w/180*Math.PI)),R=e(v+(p-r)*Math.sin(w/180*Math.PI)),B=e(x-(p-r)*Math.cos(w/180*Math.PI)),k=AmCharts.line(u,[k,R],[N,B],c,d,m,0,!1,!1,!0);i.push(k);N=this.labelOffset;this.inside||(N=-N-r);k=v+(p-r-N)*Math.sin(w/180*Math.PI);N=x-(p-r-N)*Math.cos(w/180*Math.PI);R=this.fontSize;isNaN(R)&&(R=t.fontSize);0<C&&T/C==Math.round(T/C)&&(this.showLastLabel||T!=o-1)&&(this.showFirstLabel||0!==T)&&(M=AmCharts.text(u,M,t.color,t.fontFamily,R),M.translate(k,N),i.push(M));if(T<o-1)for(M=1;M<A;M++)B=w+g*M,k=e(v+b*Math.sin(B/180*Math.PI)),N=e(x-b*Math.cos(B/180*Math.PI)),R=e(v+(b-f)*Math.sin(B/180*Math.PI)),B=e(x-(b-f)*Math.cos(B/180*Math.PI)),k=AmCharts.line(u,[k,R],[N,B],c,d,m,0,!1,!1,!0),i.push(k)}if(i=this.bands)for(s=0;s<i.length;s++)if(a=i[s])c=a.startValue,d=a.endValue,r=AmCharts.toCoordinate(a.radius,p),isNaN(r)&&(r=b),o=AmCharts.toCoordinate(a.innerRadius,p),isNaN(o)&&(o=r-f),n=h+l*c,d=l*(d-c),m=a.outlineColor,void 0==m&&(m=this.bandOutlineColor),A=a.outlineThickness,isNaN(A)&&(A=this.bandOutlineThickness),g=a.outlineAlpha,isNaN(g)&&(g=this.bandOutlineAlpha),c=a.alpha,isNaN(c)&&(c=this.bandAlpha),a=AmCharts.wedge(u,v,x,n,d,r,r,o,0,{fill:a.color,stroke:m,"stroke-width":A,"stroke-opacity":g}),a.setAttr("opacity",c),t.gridSet.push(a);this.axisCreated=!0;this.setTopText(this.topText);this.setBottomText(this.bottomText);t=t.graphsSet.getBBox();this.width=t.width;this.height=t.height}});AmCharts.GaugeArrow=AmCharts.Class({construct:function(){this.color="#000000";this.nailAlpha=this.alpha=1;this.startWidth=this.nailRadius=8;this.borderAlpha=1;this.radius="90%";this.nailBorderAlpha=this.innerRadius=0;this.nailBorderThickness=1;this.frame=0},setValue:function(t){var i=this.chart;i?i.setValue(this,t):this.previousValue=this.value=t}});AmCharts.GaugeBand=AmCharts.Class({construct:function(){}});AmCharts.AmAngularGauge=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(){AmCharts.AmAngularGauge.base.construct.call(this);this.minRadius=this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=10;this.faceColor="#FAFAFA";this.faceAlpha=0;this.faceBorderWidth=1;this.faceBorderColor="#555555";this.faceBorderAlpha=0;this.arrows=[];this.axes=[];this.startDuration=1;this.startEffect=">";this.adjustSize=!0;this.extraHeight=this.extraWidth=0;this.clockWiseOnly=!1},addAxis:function(t){t.chart=this;this.axes.push(t)},initChart:function(){AmCharts.AmAngularGauge.base.initChart.call(this);if(0===this.axes.length){var t=new AmCharts.GaugeAxis;this.addAxis(t)}for(var i,t=0;t<this.arrows.length;t++)i=this.arrows[t],i.axis||(i.axis=this.axes[0]),isNaN(i.value)&&i.setValue(i.axis.startValue),isNaN(i.previousValue)&&(i.previousValue=i.axis.startValue);this.drawChart();this.totalFrames=1e3*this.startDuration/AmCharts.updateRate},drawChart:function(){AmCharts.AmAngularGauge.base.drawChart.call(this);var t=this.container,i=this.updateWidth();this.realWidth=i;var s=this.updateHeight();this.realHeight=s;var a=AmCharts.toCoordinate,h=a(this.marginLeft,i),e=a(this.marginRight,i),r=a(this.marginTop,s)+this.getTitleHeight(),o=a(this.marginBottom,s),n=a(this.radius,i,s),a=i-h-e,l=s-r-o+this.extraHeight;n||(n=Math.min(a,l)/2);n<this.minRadius&&(n=this.minRadius);this.radiusReal=n;this.centerX=(i-h-e)/2+h;this.centerY=(s-r-o)/2+r+this.extraHeight/2;isNaN(this.gaugeX)||(this.centerX=this.gaugeX);isNaN(this.gaugeY)||(this.centerY=this.gaugeY);var i=this.faceAlpha,s=this.faceBorderAlpha,u;if(0<i||0<s)u=AmCharts.circle(t,n,this.faceColor,i,this.faceBorderWidth,this.faceBorderColor,s,!1),u.translate(this.centerX,this.centerY),u.toBack();for(i=n=t=0;i<this.axes.length;i++)s=this.axes[i],s.radiusReal=AmCharts.toCoordinate(s.radius,this.radiusReal),s.draw(),s.width>t&&(t=s.width),s.height>n&&(n=s.height);if(this.adjustSize&&!this.chartCreated){u&&(u=u.getBBox(),u.width>t&&(t=u.width),u.height>n&&(n=u.height));u=0;if(l>n||a>t)u=Math.min(l-n,a-t);0<u&&(this.extraHeight=l-n,this.chartCreated=!0,this.validateNow())}this.chartCreated=!0},validateSize:function(){this.extraHeight=this.extraWidth=0;this.chartCreated=!1;AmCharts.AmAngularGauge.base.validateSize.call(this)},addArrow:function(t){t.chart=this;this.arrows.push(t)},removeArrow:function(t){AmCharts.removeFromArray(this.arrows,t);this.validateNow()},removeAxis:function(t){AmCharts.removeFromArray(this.axes,t);this.validateNow()},drawArrow:function(t,i){t.set&&t.set.remove();var s=t.axis,a=s.radiusReal,h=this.container,e=s.centerXReal,r=s.centerYReal,o=t.startWidth,n=t.innerRadius,l=AmCharts.toCoordinate(t.radius,s.radiusReal);s.inside||(l-=15);t.set=h.set();var u=t.nailColor;u||(u=t.color);var c=t.nailColor;c||(c=t.color);u=AmCharts.circle(h,t.nailRadius,u,t.nailAlpha,t.nailBorderThickness,u,t.nailBorderAlpha);t.set.push(u);u.translate(e,r);isNaN(l)&&(l=a-s.tickLength);var s=Math.sin(i/180*Math.PI),a=Math.cos(i/180*Math.PI),u=Math.sin((i+90)/180*Math.PI),d=Math.cos((i+90)/180*Math.PI),h=AmCharts.polygon(h,[e-o/2*u+n*s,e+l*s,e+o/2*u+n*s],[r+o/2*d-n*a,r-l*a,r-o/2*d-n*a],t.color,t.alpha,1,c,t.borderAlpha,void 0,!0);t.set.push(h);this.graphsSet.push(t.set)},setValue:function(t,i){t.axis&&(t.axis.value2angle(i),t.frame=0,t.previousValue=t.value);t.value=i},updateAnimations:function(){AmCharts.AmAngularGauge.base.updateAnimations.call(this);for(var t=this.arrows.length,i,s=0;s<t;s++){i=this.arrows[s];var a;i.frame>=this.totalFrames?a=i.value:(i.frame++,i.clockWiseOnly&&i.value<i.previousValue&&(a=i.axis,i.previousValue-=a.endValue-a.startValue),a=AmCharts.getEffect(this.startEffect),a=AmCharts[a](0,i.frame,i.previousValue,i.value-i.previousValue,this.totalFrames),isNaN(a)&&(a=i.value));a=i.axis.value2angle(a);this.drawArrow(i,a)}}});
//# sourceMappingURL=gauge.map.js